package com.sc.nft.service;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.vo.AdminDaoEcologyPointsVO;
import com.sc.nft.entity.vo.AdminManagementRecordPageVO;
import com.sc.nft.enums.DaoEcologyPointsDetailAmountTypeEnum;
import com.sc.nft.enums.DaoEcologyPointsDetailRecordsTypeEnum;
import com.sc.nft.enums.PointsExchangeCollectionConsumeTypeEnum;

import java.math.BigDecimal;
import java.util.Date;

public interface DaoEcologyPointsService {

    /**
     * 增加待释放金额
     * @param daoId
     * @param amount
     * @param amountType
     * @param type
     * @return
     */
    boolean addFrozenAmountByDaoId(Long daoId, BigDecimal amount, DaoEcologyPointsDetailAmountTypeEnum amountType, DaoEcologyPointsDetailRecordsTypeEnum type, DateTime settleTime);


    /**
     * 增加待释放金额
     * @param daoId
     * @param amount
     * @param amountType
     * @param type
     * @return
     */
    boolean subFrozenAmountByDaoId(Long daoId, BigDecimal amount, DaoEcologyPointsDetailAmountTypeEnum amountType, DaoEcologyPointsDetailRecordsTypeEnum type, DateTime settleTime);


    /**
     * 增加可用金额 减去冻结金额
     * @param daoId
     * @param amount
     * @param type
     * @return
     */
    void addAmountAndSubFrozenAmount(Long daoId, BigDecimal amount, DaoEcologyPointsDetailRecordsTypeEnum type);

    /**
     * 增加可用金额(分红池流入)
     * @param daoId
     * @param amount
     * @param type
     * @return
     */
    void addAmount(Long daoId, BigDecimal amount, DaoEcologyPointsDetailRecordsTypeEnum type,String remark);
    /**
     * 增加可用金额(分红池流入)
     * @param daoId
     * @param amount
     * @param type
     * @return
     */
    void subAllAmount(Long daoId, BigDecimal amount, DaoEcologyPointsDetailRecordsTypeEnum type,String remark);

    /**
     * 分页获取DAO燃料列表
     * @param daoName
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<AdminDaoEcologyPointsVO> getPage(String daoName, Integer pageNo, Integer pageSize);

    /**
     * 编辑DAO燃料
     * @param daoId
     * @param isAdd
     * @param amount
     * @param remark
     */
    void editDaoPoints(Long daoId, Boolean isAdd, String amount, String remark);

    /**
     * 管理记录分页
     * @param daoId
     * @param isAdd
     * @param startTime
     * @param endTime
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<AdminManagementRecordPageVO> managementRecordPage(Long daoId, Boolean isAdd, Date startTime, Date endTime, Integer pageNo, Integer pageSize);

    /**
     * 燃料兑换nft
     * @param toUserId
     * @param daoId
     * @param applyNum
     * @param collectionId
     * @param needPoints
     */
    void pointApplyExchange(Long toUserId, Long daoId, Integer applyNum, Long collectionId, BigDecimal needPoints, Long pointsId, PointsExchangeCollectionConsumeTypeEnum consumeTypeEnum);
}
